#ifndef BINANCEC__SERVER_WEBSERVICE_H
#define BINANCEC__SERVER_WEBSERVICE_H
#include <sys/epoll.h>
#include "../../include/strategy/strategyservice.h"
#include "../../include/threadpool/threadpool.h"
#include "../../include/log/log.h"

const int MAX_EVENT_NUMBER = 10000;
const int MAX_FD = 65536;

class WebService
{
public:
    void init();
    void startListen();
    void AddFd();
    void DelFd();
    bool dealReadMessage(int);
    bool dealWriteMessage(int);

    epoll_event event;
    epoll_event events[MAX_EVENT_NUMBER];
    int port;
    int listenFd;
    int epollFd;

private:
    CoinPrice* coinPrice;
    int price;
    ThreadPool* threadPool;
    int threadNumber;
    StrategyService* allUsers;
};

#endif
